import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'
import Hi from '@/components/hi'
import tableData from '@/components/tableShow'

import artile from '@/components/createArtile'

Vue.use(Router)

var bus = new Vue();
const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Hello',
      component: Hello
    },
    {
      path: '/hi',
      name: 'hi',
      component: Hi
    },
    {
      path: '/table',
      name: 'table',
      component: tableData
    },{
      path: '/artile',
      name: 'artile',
      component: artile,
      meta:{
        auth: 'auth'
      }

    }
  ]
})
router.beforeEach((to, from, next) => {
  if(to.meta.auth){

  }
  if(to.name==='table'){
    console.log("router to #/table");
  }
  next();
})


export default router
